package org.nepu.scr.indexrate.converter.compliancerate.naturesecurity;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.compliancerate.naturesecurity.DrillingA31;

import javax.persistence.AttributeConverter;

public class DrillingA31Converter implements AttributeConverter<DrillingA31, String> {
    @Override
    public String convertToDatabaseColumn(DrillingA31 drillingA31) {
        return JSONUtil.toJsonStr(drillingA31);
    }

    @Override
    public DrillingA31 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, DrillingA31.class);
    }
}
